﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebWYSIWYG.controls
{
    public partial class WysiwygControl : System.Web.UI.UserControl
    {
        protected String HTMLtext;
        protected String savedHTMLtext;

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        public void SetHtml(String input)
        {
            HTMLtext = input;
        }

        public String GetHtml()
        {
            return savedHTMLtext;
        }

        protected void ClickSave(object sender, EventArgs e)
        {
            savedHTMLtext = Request.Form["divHidden"];

            TextWriter tw = new StreamWriter(Server.MapPath("~/savedHTML.txt"));
            tw.WriteLine(savedHTMLtext);
            tw.Close();
        }
    }
}